/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ObjetData;

/**
 *
 * @author julien
 */
public class CommandeLigne {

    private double prixUnitaire;
    private int quantite;
    private Article article;

    public Article getArticle() {
        return article;
    }

    public double getPrixUnitaire() {
        return prixUnitaire;
    }

    public int getQuantite() {
        return quantite;
    }

    public double getHt() {
        double rs = (double) this.quantite * this.prixUnitaire;
        return Math.round(rs * Math.pow(10, 2)) / (Math.pow(10, 2));
    }

    public double getTva() {
        double rs = this.getHt() * article.getTva() / 100;
        return Math.round(rs * Math.pow(10, 2)) / (Math.pow(10, 2));
    }

    public double getTTC() {
        double rs = this.getHt() + this.getTva();
        return Math.round(rs * Math.pow(10, 2)) / (Math.pow(10, 2));
    }

    public void setArticle(Article article) {
        this.article = article;
    }

    public void setPrixUnitaire(double prixUnitaire) {
        this.prixUnitaire = prixUnitaire;
    }

    public void setQuantite(int quantite) {
        this.quantite = quantite;
    }
}
